def id(x):
    if x==932071:
        return 0
    if x==114049:
        return 1
    if x==313903:
        return 2
    if x==955962:
        return 3
    if x==243813:
        return 4
    if x==304985:
        return 5
    if x==914500:
        return 6
    if x==961995:
        return 7
    if x==933328:
        return 8
    else:
        return 0

def PRINT(x,l):
    tep=str(x)
    print(tep,end='')
    L=len(tep)
    for i in range(L+1,l+1):
        print(" ",end='')

name=['chips','chocolate','cookie','cupcake','milk','soap','teapot','toothbrush','toothpaste']
Len=[0,0,0,0,0,0,0,0,0]
cnt=[0,0,0,0,0,0,0,0,0]
for i in range(9):
    Len[i]=len(name[i])
price=[3.50,8.00,6.50,4.90,3.20,2.90,29.80,4.80,9.30]

while True:
    x=int(input())
    if x==0:
        break
    cnt[id(x)]+=1


MaxLen=4
for i in range(9):
    if cnt[i]>0 and Len[i]>MaxLen:
        MaxLen=Len[i]

print("NAME",end='')
for i in range(5,MaxLen+1):
    print(" ",end='')
print(" QUANTITY PRICE SUM")

Sum=0
for i in range(9):
    if cnt[i]==0:
        continue
    PRINT(name[i],MaxLen)
    print(" ",end='')
    
    PRINT(cnt[i],8)
    print(" ",end='')
    
    PRINT(price[i],5)
    print(" ",end='')
    
    print("%.2f" % (price[i]*cnt[i]))
    Sum+=price[i]*cnt[i]

print("total:%.2f" % Sum)